<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/8/26
  Time: 15:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% String path = request.getContextPath(); %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/jquery-3.5.1.min.js"></script>

<style>
    #hide{
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        position: fixed;
        background-image: url("<%=path%>/static/web/css/img/overlay.png");
        opacity: 1;
        z-index: 100;

    }
    #hide #mes{
        margin: 0;
        padding: 0;
        width: 50%;
        height: 70%;
        position: absolute;
        left: 25%;
        top: 15%;
        z-index: 120;
        border: #3a3a3a 8px solid;
        background-color: #cccccc;
    }
    #hide #mes #header{
        margin: 0;
        padding: 0;
        background-color:#019875;
        height: 50px;
        z-index: 150;
        color: white;
    }
    #hide #mes #header #but{
        position: relative;
        background-image: url("<%=path%>/static/web/css/img/controls.png");
        width: 30px;
        height: 30px;
        float: right;
        border:#019875 0px solid;
    }
    #hide #mes #header #but:hover{
        cursor: pointer;
    }
    #hide #mes #header #title{
        font-size: 25px;

    }
    #hide #mes div {
        margin-top: 10px;
        padding: 0;
        height: 50px;
        z-index: 150;
        color: #0C0C0C;
        font-size: 20px;
    }
    #images img{
        width: 80px;
        height: 80px;
        border-radius: 50%;
    }
    .city{
        width: 100px;
        height: 30px;
    }
    .job{
        height: 30px;
    }
    .money{
        height: 30px;
    }

</style>
<script>
    $(function () {
        $("#but").click(function () {
            $("#hide").css("display","none");
        });
    });
</script>
<div id="hide">
    <div id="mes">
        <div id="header">
            <span id="title">期望工作</span>
            <button id="but"></button>
        </div>
        <div class="dele">
        <div id="detailed">
            <span style="margin-left: 10px">期望城市:<select class="city">
                <option value="${hopeJob.city.id}">${hopeJob.city.cityName}</option>
                <c:forEach items="${cityList}" var="city">
                    <option value="${city.id}">${city.cityName}</option>

                </c:forEach>

            </select></span>
        </div>
        <div >
            <span style="margin-left: 10px">期望职位:</span><input class="job" value="${hopeJob.jobName}">
        </div>
        <div id="education">
            <span style="margin-left: 10px" class="natureSpan">工作性质:</span>
            <ul class="profile_radio clearfix reset" id="nature">

                <c:forEach items="${natureList}" var="nature">
                    <%--												class="current"--%>
                    <input type="hidden" id="natureIds"name="natureid">
                    <li data-id="${nature.id}"  class="nature">
                        <span >${nature.title}</span><em></em>
                        <input type="radio" class="natureInput" checked="" name="type"  value="${nature.title}">
                    </li>

                </c:forEach>

            </ul>
        </div>
        <div>
            <span style="margin-left: 10px">期望月薪:&nbsp</span>
            <select class="money">
                <option value="${hopeJob.money.id}">${hopeJob.money.range}</option>
                <c:forEach items="${moneyList}" var="money">
                    <option value="${money.id}">${money.range}</option>
                </c:forEach>

            </select>
        </div>
        <div>
           <button class="But">点击修改</button>
            <button class="delete" data-id="${hopeJob.id}" style="float: right">点击删除</button>
        </div>
    </div>
    </div>
</div>

<script>
    $(function () {
        $(".nature").click(function () {
            var id=$(this).data("id");
            $(".nature").css("background","");
            $(this).css("background","#91cebe");

        })
        $("#nature>li").click(function () {
            var id=$(this).data("id");
            $("#natureId").val(id)
        });
        $(".delete").click(function () {
            var id=$(this).data("id");


            $.ajax({
                url:path+"/zhuang/user/deleteHopeJob",
                type:"post",
                data:{"id":id},
                success:function (data) {


                }
            })
            location.href="${pageContext.request.contextPath}/zhuang/user/jianli";


        })

        $(".But").click(function () {
            var jobId= ${hopeJob.id};
            //alert(JobId)
            var cityId=$(".city").val();
            var job=$(".job").val();
            var natureId=$("#natureId").val();
            var moneyId=$(".money").val();
            location.href="${pageContext.request.contextPath}/zhuang/user/jianli";

            $.ajax({
                url:path+"/zhuang/user/updateHopeJob",
                type:"post",
                data:{"jobId":jobId,"cityId":cityId,"natureId":natureId,"moneyId":moneyId,"job":job},
                success:function (data) {
                    alert("上传成功")

                }
            })




        })


    })
</script>
